console.log('目前只有这一个');

class Anima1 {
    name: string;
    age: number;
    constructor(name: string, age: number) {
        this.name = name;
        this.age = age;
    }
    sex: string = '男'
    jump(str: string): void {
        console.log(str);
        console.log('没电了');


    }
    run(str: number): number {
        console.log('xxx');
        console.log(num);
        return num

    }
    static song(): any {
        console.log('结束了');

    }
    static color: string = '黄皮肤'
}
let cat = new Anima1('呼呼呼', 123);
console.log(cat);
cat.jump('111');
let dog = new Anima1('dahuang', 22);
console.log(dog);
console.dir(Anima1);
Anima1.song();
console.log(Anima1.color);


class Person extends Anima1 {
    constructor(name: string, age: number) {
        super(name, age)
    }
    jump(str: string): void {
        super.jump(str);
    }
    static song(): any {
        super.song();
    }
}

let liming = new Person('liming', 123456);
console.log(liming);


class SunWei {
    public name: string;
    private age: number;
    protected sex: string;
    readonly hobby: string;
    constructor(name: string, age: number, sex: string, hobby: string) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.hobby = hobby
    }
    show(): void {
        console.log(this.name);
        console.log(this.age);
        console.log(this.sex);



    }
}

let xiaosunwei = new SunWei('男的', 10, '男', '打游戏');
console.log(xiaosunwei);
console.log(xiaosunwei.name);
xiaosunwei.show();


class SunWenWen extends SunWei {
    constructor(name: string, age: number, sex: string, hobby: string) {
        super(name, age, sex, hobby);
    }
    test(): void {
        console.log(this.sex);

    }
}
let Wen = new SunWenWen('小孩', 2, '女', '吃');
console.log(Wen);
Wen.test();
console.log(xiaosunwei.hobby);
console.log(xiaosunwei.hobby);


class XiaoLi {
    constructor(public name: string, public age: number) {
        this.name = name;
        this.age = age;
    }
}
let lili = new XiaoLi('xuesheng', 20);
console.log(lili);

class XiWang {
    name: string = '感动';
    hobby: string = '吃饭睡觉';
    get bu(): string {
        return this.name + this.hobby;
    }
    set bu(value) {
        console.log(value);

    }
}
let xiaolong = new XiWang();
console.log(xiaolong.bu);
xiaolong.bu = '匆匆忙忙';


abstract class Parent {
    abstract run();
    abstract jump();
}
class Son extends Parent {
    run() {
        console.log('去放纵');

    }
    jump() {
        console.log('嫉妒');

    }
}
let Danny = new Son();
Danny.run();
Danny.jump();